import React from 'react'
import {
  Row,
  Col,
  Button,
  Radio,
  Checkbox,
  Slider,
  Table,
  Image,
  Input,
  Select,
} from 'antd'
import Elements from '@models/Elements'
import { EControls } from '@/enums'
interface IProps {
  el: Elements
}

const Variant: React.FunctionComponent<IProps> = ({ el }) => {
  switch (el.type) {
    case EControls.row:
      return <Row></Row>
    case EControls.col:
      return <Col></Col>
    case EControls.button:
      return <Button>按钮</Button>
    case EControls.table:
      return <Table></Table>
    case EControls.image:
      return <Image></Image>
    case EControls.text:
      return <span>文本</span>
    case EControls.input:
      return <Input></Input>
    case EControls.textarea:
      return <textarea></textarea>
    case EControls.select:
      return <Select></Select>
    case EControls.radio:
      return <Radio></Radio>
    case EControls.checkbox:
      return <Checkbox></Checkbox>
    case EControls.slider:
      return <Slider></Slider>
    default:
      return <div></div>
  }
}

export default Variant
